x86emul: consolidate loop counter handling
authorJan Beulich <jbeulich@suse.com>
Fri, 9 Dec 2016 14:51:18 +0000 (15:51 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 9 Dec 2016 14:51:18 +0000 (15:51 +0100)
commit847464b5d9bfdae3120bd9cc7e86aa42867d8085
treee5c9237e68c987de5dd01374086459cdf2c7a5c7
parent739d05ebb9ccadd4b6f93f8bf288d8c8c6b04c02
x86emul: consolidate loop counter handling

Rename _get_rep_prefix() to make it more visibly fit other use cases
and introduce a companion "put". Use them for repeated string insn
handling as well as LOOP/J?CXZ instead of open coding the same logic a
couple of times.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/x86_emulate.c